import random
a_str = 'abcdefghijklmnopqrstuvwxyz'
lst = []
for i in range(100):
    sum = ''
    for j in random.choices(a_str,k=2):
        sum += j
    lst.append(sum)
s = set(lst)
d = {}
for k in s:
    d.update({k:lst.count(k)})
d1 = sorted(d.items(),reverse=True)
print(d1)


# 排序结果有点问题，没有按照出现次数排序
